import { combineReducers } from "redux";
import { IHotSong, IPlaylistResult } from "../actions/hotsongs.action";
import { INewSong } from "../actions/newsongs.action";
import { IRecommendItem } from "../actions/recommend.action";
import { ISongUrl } from "../actions/songurl.action";
import hotSongsReducer from "./hotsongs.reducer";
import newSongsReducer from "./newsongs.reducer";
import processReducer from "./process.reducer";
import recommendListReducer from "./recommend.reducer";
import songDetailReducer from "./songdetail.reducer";
import songUrlReducer from "./songurl.reducer";
import tabBarIndexReducer from "./tabbarindex.reducer";
import testReducer from "./test.reducer";

export interface AppStore {
  test: number;
  tabBarIndex: number;
  recommendList: IRecommendItem[];
  newSongsList: INewSong[];
  hotSongsList: IPlaylistResult;
  songDetail: IHotSong;
  songUrl: ISongUrl;
  process: string;
}

const rootReducer = combineReducers({
  test: testReducer,
  tabBarIndex: tabBarIndexReducer,
  recommendList: recommendListReducer,
  newSongsList: newSongsReducer,
  hotSongsList: hotSongsReducer,
  songDetail: songDetailReducer,
  songUrl: songUrlReducer,
  process: processReducer,
});

export default rootReducer;
